/**
 * Created by yww on 2017/4/28 0028.
 */
import axios from 'axios';
import {API_VERSION, API_NEW_VERSION} from '../api';
export const getUserByUserId = (userId, token) => {
  return axios.get(API_VERSION + 'meb_users_byuserid?userId=' + userId);
};

export const getUserById = (id, token) => {
  return axios.get(API_VERSION + '/meb_users/' + id, token);
};

// 根据ID，获取地址列表
export const getAddresses = id => {
  let myid = `pid=` + id;
  return axios.get(API_VERSION + `address_dicts`, {params: {filters: myid}});
};

// 保存
export const saveMemberUser = (params) => {
  return axios.post(API_VERSION + 'mebpersonalcenter', params);
};

// 根据邀请码，获取合伙人详情
export const findByInviteCode = id => {
  return axios.get(API_NEW_VERSION + 'partners_by_invitecode', {params: {inviteCode: id}});
};
